package com.tbit.main.service.impl;

import com.tbit.main.dao.core.SmsAuthConfigDao;
import com.tbit.main.pojo.SmsAuthConfig;
import com.tbit.main.service.SmsAuthConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author LMY
 * @create 2020-10-22 14:52
 */
@Service("smsAuthConfigService")
public class SmsAuthConfigServiceImpl implements SmsAuthConfigService {
    @Autowired
    private SmsAuthConfigDao smsAuthConfigDao;

    @Override
    public SmsAuthConfig getByAccountId(Integer accountId) {
        SmsAuthConfig smsAuthConfig = smsAuthConfigDao.getByAccountId(accountId);
        /** 兼容波思出行*/
        if (smsAuthConfig == null || smsAuthConfig.getAccountId().equals(100019)) {
            smsAuthConfig = new SmsAuthConfig();
            smsAuthConfig.setSmsCodeKey("5f272cb18fac070fbefb93121afc4916");
            smsAuthConfig.setSmsModelId("91995");
            smsAuthConfig.setFrom(0);
        }
        return smsAuthConfig;
    }

    @Override
    public List<SmsAuthConfig> getAll() {
        return smsAuthConfigDao.getByAll();
    }
}
